//
//  SecondViewController.m
//  WeatherCast
//
//  Created by anlong on 14/11/15.
//  Copyright (c) 2014年 anlong. All rights reserved.
//

#import "SecondViewController.h"

@interface SecondViewController ()

@end

@implementation SecondViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    UINavigationItem *navigationItem = [[UINavigationItem alloc] initWithTitle:nil];
    //创建一个左边按钮
    UIBarButtonItem *leftButton = [[UIBarButtonItem alloc] initWithTitle:@"<"
                                                                   style:UIBarButtonItemStyleBordered
                                                                  target:self
                                                                  action:@selector(onClickButton)];
    
    //创建一个右边按钮
    UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithTitle:@">"
                                                                    style:UIBarButtonItemStyleDone
                                                                   target:self
                                                                   action:@selector(onClickButton)];
    
    //    [rightButton setBackgroundImage:[UIImage imageNamed:@"add_hover@2x.png"]forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
    //设置导航栏内容
    [navigationItem setTitle:@"日历"];
    //把左右两个按钮添加入导航栏集合中
    [navigationItem setLeftBarButtonItem:leftButton];
    [navigationItem setRightBarButtonItem:rightButton];
    
    UINavigationBar* naviagteBar = [[UINavigationBar alloc] initWithFrame: CGRectMake(0, 0, 320, 70)];
    
    //把导航栏集合添加入导航栏中，设置动画关闭
    [naviagteBar pushNavigationItem:navigationItem animated:YES];
    
    [naviagteBar setBackgroundImage:[UIImage imageNamed:@"bottom_bar_monitor@2x.png"] forBarMetrics:UIBarMetricsDefault];
    
    [self.view addSubview:naviagteBar];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)onClickButton
{
    NSLog(@"onClickButton");
}

@end
